import logging
from appium.webdriver.common.mobileby import MobileBy
from base.base_page import BasePage
from pages.contacts_page import ContactsPage


class MainPage(BasePage):

    _contacts_locator = (MobileBy.XPATH, "//*[@text='通讯录']")

    def go_to_contacts(self):
        logging.info("调用go_to_contacts方法")
        self.find_and_click(self._contacts_locator)
        return ContactsPage(self.driver)
